<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://www.ufida.com/lfw" prefix="lfw" %>
<%@ taglib uri="http://www.ufida.com/uif" prefix="uif" %> 
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://www.ufida.com/multilang" prefix="ml" %>
<html>
	<head>
		<lfw:base/>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<uif:import/>
		<script type='text/javascript' src='code/approvedlg.pagemeta'></script>
		<script type='text/javascript' src='/lfw/frame/script/chart/ChartComp.js'></script>
		<style>
			* {
				font: 12px;
				FONT-FAMILY: arial;
			}
		</style>
	</head>

	<body bottommargin="0" topmargin="0" leftmargin="0" rightmargin="0" scroll=no onload="pageBodyScript()" style="background:#ffffff">
		<%
			String billId = request.getParameter("billId");
			String billType = request.getParameter("billType");
			pageContext.setAttribute("billId", billId);
			pageContext.setAttribute("billType", billType);
		%>
		<lfw:pageModel className="nc.lfw.core.model.FromPublicPageModel">
			<lfw:layout type="border">
				<lfw:layoutPanel position="top" height="100">
					<lfw:layout type="flowv">
						<lfw:layoutPanel height="26" align="center">
								<lfw:label id="histroyLabel"></lfw:label>
							</lfw:layoutPanel>
						<lfw:layoutPanel height="120">
							<lfw:grid id="flowHistroy"></lfw:grid>
						</lfw:layoutPanel>
					</lfw:layout>
				</lfw:layoutPanel>
					
				<lfw:layoutPanel position="center" height="100">
					<lfw:layout type="flowv"> 
					    <lfw:layoutPanel height="26">
					    	<lfw:label id="approveMsg"/>
					    </lfw:layoutPanel>
					    
					    <lfw:layoutPanel>
					    	<lfw:layout type="flowh">
					    		<lfw:layoutPanel width="12">
					    			&nbsp;
					    		</lfw:layoutPanel>
					    		<lfw:layoutPanel>
							    	<lfw:border type="solid" width="1" color="#A0B3C6">
							    		<lfw:layout type="flowv">
							    			<lfw:layoutPanel height="10">
							    				&nbsp;
							    			</lfw:layoutPanel>
							    			<lfw:layoutPanel height="30">
									    		<lfw:layout type="flowh">
										    		<lfw:layoutPanel width="110" align="right">
										    			<lfw:radio id="approve"></lfw:radio>
										    		</lfw:layoutPanel>
										    		<lfw:layoutPanel width="110">
										    			<lfw:radio id="unapprove"></lfw:radio>
										    		</lfw:layoutPanel>
										    		<lfw:layoutPanel width="110">
										    			<lfw:radio id="backward"></lfw:radio>
										    		</lfw:layoutPanel>
										    	</lfw:layout>	
									    	</lfw:layoutPanel>	
							    		</lfw:layout>
							    	</lfw:border>
					    		</lfw:layoutPanel>
					    		<lfw:layoutPanel width="12">
					    			&nbsp;
					    		</lfw:layoutPanel>
					    	</lfw:layout>
					    </lfw:layoutPanel>
					    
					    <lfw:layoutPanel height="10">
					    </lfw:layoutPanel>
					    
					    <lfw:layoutPanel height="26" valign="top">
					    	<lfw:label id="approveContentLabel"/>
					    </lfw:layoutPanel>
					    
					  	<lfw:layoutPanel height="60" valign="top">
					  		<lfw:textarea id="approveContent"/>
					    </lfw:layoutPanel>
					</lfw:layout> 
				</lfw:layoutPanel>
				
				<lfw:layoutPanel position="bottom">
					<lfw:layout type="flowh">
						<lfw:layoutPanel width="40">
							&nbsp;
						</lfw:layoutPanel> 
					    <lfw:layoutPanel width="150" align="right">
							<lfw:button id="okbt"></lfw:button>
						</lfw:layoutPanel>
						<lfw:layoutPanel width="150">
							<lfw:button id="cancelbt"></lfw:button>
						</lfw:layoutPanel>
						<lfw:layoutPanel width="150" align="left">
							<lfw:button id="pfInfoBt"></lfw:button>
						</lfw:layoutPanel>
						<lfw:layoutPanel width="150" align="left">
							<lfw:button id="assignbt"></lfw:button>
						</lfw:layoutPanel>
						<lfw:layoutPanel width="100">
							&nbsp;
						</lfw:layoutPanel> 
					</lfw:layout>		
				</lfw:layoutPanel>
			</lfw:layout>
			 
			<lfw:dialog id="flowDialog">
				<lfw:layout type="flowv">
					<lfw:layoutPanel height="250" width="430">
						<div style="background:#ffffff;position:absolute;top:0;left:0;width:100%;height:238;overflow:auto"><img src="wfimg?billType=${billType}&billId=${billId}"/></div>
					</lfw:layoutPanel>
				</lfw:layout>
			</lfw:dialog>
			 
		</lfw:pageModel>
	</body>
	<script language="javascript">
		function externalInit()
		{
			var grid = getComponent("flowHistroy");
			if(grid != null)
			{
				grid.outerDiv.style.borderTop = "solid #A0B3C6 1px";
				grid.outerDiv.style.borderBottom = "solid #A0B3C6 1px";
			}
			var haveAssign = getParameter("haveAssign");
			if(haveAssign == "Y"){
				getComponent("assignbt").setActive(true);
				getComponent("okbt").setActive(false);
			}
		}

	
		function PfInfoRender(){}
		PfInfoRender.render = function(rowIndex, colIndex, value, header, cell)
		{	 
			var pfStateArray = ["${ml:trans('yer_pfinfo000')}","${ml:trans('yer_pfinfo001')}","${ml:trans('yer_pfinfo002')}","${ml:trans('yer_pfinfo003')}","${ml:trans('yer_pfinfo004')}"]; 
			cell.style.overflow = "hidden";
			cell.style.textOverflow = "ellipsis";
			cell.style.cursor = "default";
			cell.style.textAlign = "center";
			cell.innerHTML  = "<center>" + pfStateArray[value] + "<center>" ;
		}
		function PfResultRender(){} 
		PfResultRender.render = function(rowIndex, colIndex, value, header, cell)
		{	
			cell.style.overflow = "hidden";
			cell.style.textOverflow = "ellipsis";
			cell.style.cursor = "default";
			cell.style.textAlign = "center";
			var  result = '';
			if(value == 'Y') result = "${ml:trans('yer_pfinfo005')}";
			else if(value == 'N') result = "${ml:trans('yer_pfinfo006')}";
			else if(value == 'R') result = "${ml:trans('yer_pfinfo007')}";
			cell.innerHTML  = "<center>" + result + "<center>" ;
		}
		function setAssPks2ApprovePage(items){
			var params = '';
			if(items != null){
				for(var i=0; i<items.length; i++){
					if(items[i] != null && items[i] != '')
						params += items[i] + '$';
				}
			}
			getComponent("okbt").setActive(true);
			window.assign_pks = params;
		}
		function getAssignPks(){
			return window.assign_pks;
		}
		function openAssignDlg(){
			//打开指派框
			var url = getCorePath() + "/assign.jsp?pageId=assign&action=approve&rand=" + (Math.random()*10000).toString().substring(0, 4);
			showDialog(url , trans('ml_assigninfo'), "580", "420", "assignable_info_dialog", false,true);
		}
	</script>
</html>